package com.mit.web.business.remote
{
	import flash.utils.setTimeout;
	
	public class SyncResponder extends AbstractResponder
	{
		private var d:Number;
		public function SyncResponder(defaultFaultListerner:Function=null, delay:Number = 1)
		{
			super(defaultFaultListerner);
			if(delay < 1)
				throw new Error("delay must be equals or bigger than 1");
			d = delay;
		}
		
		public function invokeResult(data:Object):void{
			flash.utils.setTimeout(super.notifyResultListeners, d, data);
		}
		
		public function invokeFault(info:Object):void{
			
			flash.utils.setTimeout(super.notifyFaultListeners, d, info);
		}
	}
}